//同族类类型转换   
#include <iostream>
using namespace std;
 
class A
{
public:
    int x;
};

class B:public A
{
public:
    int y;
};

int main(int argc, char const *argv[])
{
    A *p1 = new B;  //向上转换
    p1->x = 200;

    //B *p2 = new A;//错误，向下转换

    B *p3 = (B *)new A;
    return 0;
}
